window.onload = function () {
    let cookieStr = document.cookie;
    let cookieArr = cookieStr.split(';');
    let bool = false;
    let username;
    for (let i = 0; i < cookieArr.length; i++) {
        let str = cookieArr[i].trim();
        let key = "username=";
        if (str.startsWith(key)) {
            bool = true;
            username = str.substring(key.length, str.length);
            break;
        }
    }
    if (bool) {

    } else {
        location.href = '../view/login.html'
    }
}